﻿Ext.define("LibOCApp.controller.libOC", {
    extend: "Ext.app.Controller",
    config: {
        refs: {
            loginForm: "aliasloginForm",
            loginContainer: "aliasloginContainer"
        },
        control: {
            loginForm: {
                loginBtnCmd: "onLoginBtnCmd"
            },
            loginContainer: {
                backLoginBtnCmd: "onBackLoginBtnCmd"    
            }
        }
    },
    onBackLoginBtnCmd: function() {
        console.log("onBackLoginBtnCmd");
        var loginForm = this.getLoginForm();
        Ext.Viewport.animateActiveItem(loginForm, { type: 'slide', direction: 'right' });
    },
    onLoginBtnCmd: function() {
        console.log("onLoginBtnCmd");
        var loginContainer = this.getLoginContainer();
        Ext.Viewport.animateActiveItem(loginContainer, { type: 'slide', direction: 'left' });
        var store = Ext.getStore("ordenCompra");
        console.log(store);
    },
    launch: function() {
        this.callParent(arguments);
        Ext.getStore("ordenCompra").load();
        console.log("launch");
    },
    init: function() {
        this.callParent(arguments);
        console.log("init");
    }
});